home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DriverIcons.h
-
- Contains: All declarations and types that are associated with the
- Driver's Drive and Media Icons.
-
- Version: 1.0
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
-
- #ifndef __DRIVERICONS__
- #define __DRIVERICONS__
-
- #include <MacTypes.h>
- #include <Icons.h>
-
- // The following structures are from the Prerelease of Universal Headers 3.2
- // These support the new 'icns' icon family structures.
- // These should be removed once the Headers are updated to UH 3.2
-
- /* IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.*/
- typedef struct OpaqueIconRef* IconRef;
-
- /*
- IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).
- For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
- the classic custom icons (individual 'ics#, ICN#, etc) are fetched. If the fetch of the icns resource
- succeeds then the icns is looked at exclusively for the icon data.
- For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
- This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
- MacOS Finder.
- DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
- driver icon for a particular device. The result of the kdgMediaIconSuite call to DriverGestalt should
- be a pointer an an IconFamily. In this manner driver vendors can provide rich, detailed drive icons
- instead of the 1-bit variety previously supported.
- */
-
- enum {
- kIconFamilyType = FOUR_CHAR_CODE('icns')
- };
-
-
-
- struct IconFamilyElement {
- OSType elementType; /* 'ICN#', 'icl8', etc...*/
- Size elementSize; /* Size of this element*/
- unsigned char elementData[1];
- };
- typedef struct IconFamilyElement IconFamilyElement;
-
- struct IconFamilyResource {
- OSType resourceType; /* Always 'icns'*/
- Size resourceSize; /* Total size of this resource*/
- IconFamilyElement elements[1];
-
- };
- typedef struct IconFamilyResource IconFamilyResource;
-
- typedef IconFamilyResource * IconFamilyPtr;
- typedef IconFamilyPtr * IconFamilyHandle;
-
- /*
- Use the special creator kSystemIconsCreator to get "standard" icons
- that are not associated with a file, such as the help icon.
- */
-
- enum {
- kSystemIconsCreator = FOUR_CHAR_CODE('macs')
- };
-
- enum {
- kGenericFloppyIcon = FOUR_CHAR_CODE('flpy')
- };
-
-
- /*
- IconRefToIconFamily
- This routines returns a new IconFamily that contains the data corresponding
- to the specified IconRef
- */
-
- EXTERN_API( OSErr )
- IconRefToIconFamily (IconRef theIconRef,
- IconSelectorValue whichIcons,
- IconFamilyHandle * iconFamily) TWOWORDINLINE(0x7024, 0xAA75);
-
-
- /*
- GetIconRef
-
- This routine returns an icon ref for an icon in the desktop database or
- for a registered icon.
- The system registers a set of icon such as the help icon with the creator
- code kSystemIconCreator. See above for a list of the registered system types.
- The vRefNum is used as a hint on where to look for the icon first. Use
- kOnSystemDisk if you don't know what to pass.
- This routine increments the reference count of the returned IconRef. Call
- ReleaseIconRef() when you're done with it.
- */
-
- EXTERN_API( OSErr )
- GetIconRef (SInt16 vRefNum,
- OSType creator,
- OSType iconType,
- IconRef * theIconRef) TWOWORDINLINE(0x7021, 0xAA75);
-
-
-
- // End of Universal Headers 3.2 prerelease info
-
- // These structures are for the Black and white 1 bit icons
- typedef SInt16 DiskIcon[128]; // Structure for disk icon data (256 bytes)
-
- extern DiskIcon CartridgeIcon;
- extern DiskIcon AppleFloppyMediaIcon;
-
- // These variables are used for color icon support.
- // They will be set to nil if the IconServicesLib couldn't be found
- extern IconFamilyPtr CartridgeMediaIconFamily;
- extern IconFamilyHandle FloppyMediaIconFamily;
-
- // Function call to create the color icon families
- extern void BuildMediaIconFamily( void );
-
- // Function call to remove the color icon families and reclaim any memory
- extern void DestroyMediaIconFamily( void );
-
- #endif /* __DRIVERICONS__ */
-